struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2){
    struct ListNode *p,*r,*m;
    int sum=0,t=0,cnt;
    p=(struct ListNode *)malloc(sizeof(struct ListNode));
      p->next=NULL;
      m=p;
    while(l1 != NULL||l2 != NULL){
      r=(struct ListNode *)malloc(sizeof(struct ListNode));
        int x= l1==NULL?0:l1->val;
        int y= l2==NULL?0:l2->val;
        if(l1!=NULL) l1=l1->next;
        if(l2!=NULL) l2=l2->next;
         cnt=x+y+t;
        if(cnt>=10){
          sum=cnt%10;
          t=cnt/10;
        }else{
          sum=cnt;
           t=0;
        }
        r->val=sum;
        m->next=r;
        m=r;
     }
     if(cnt>=10){
       sum=cnt/10;
        r=(struct ListNode *)malloc(sizeof(struct ListNode));
        r->val=sum;
        m->next=r;
        m=r;
     }
     m->next=NULL;
     return  p->next;
}
